package com.springcloud.eshop.datasync.enums;

/**
 * @Desc:
 * @Date: 2020-07-02
 * @Version:v1.0
 */
public enum EventTypeEnum {
    ADD("add", "新增"),
    UPDATE("update", "更新"),
    DELETE("delete", "删除"),
    QUERY("query", "查询");

    EventTypeEnum(String type, String desc) {
        this.type = type;
        this.desc = desc;
    }

    /**
     * @Desc: 判断是否是新增或更新操作
     * @Param type
     * @Return boolean
     * @Date: 2020/7/2
     */
    public static boolean isAddOrUpdate(String type) {
        if (ADD.getType().equals(type) || UPDATE.getType().equals(type)) {
            return true;
        }
        return false;
    }

    private String type;

    private String desc;

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }}
